<template>
	<view class="help-detail">
		<view class="content">
			<rich-text :nodes="detail.content"></rich-text>
		</view>
	</view>
</template>

<script>
	import {getHelpDetail} from '@/api/entrance.js'
	export default{
		name:"help-detail",
		data(){
			return{
				detail:{},
				id:''
			}
		},
		onLoad(option) {
			this.id = option.id ? option.id : '';
			this.getHelpDetail(this.id);
		},
		methods:{
			async getHelpDetail(){
				let res = await getHelpDetail({
					id:this.id
				})
				if(res.code ===1){
					if(res.data.length){
						res.data[0].content = res.data[0].content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;" ')
						this.detail = res.data[0]
					}
				}
			}
		}
	}
</script>

<style lang="less" scoped src="./help-detail.less">
</style>
